// 引入路由相关依赖：Switch, Route
import React,{ Component } from 'react'
import {Switch, Route} from 'react-router-dom'
// 引入页面对应的组件
import ComF from './components/ComF'
import ComG from './components/ComG'
import NotFound from './components/NotFound'
import Life from './components/Life'
import Qiantao from './components/Qiantao'
import Index from './components/Index'
import Table from './components/Table'

export default class Router extends React.Component {
  render() {
    return (<Switch>
      {/* exact：严格匹配 */}
      <Route exact path="/" component={ComF}></Route>
      {/* 定义一个动态路由，和vue中的方式一样 */}
      <Route path="/comg/:id" component={ComG} />
      <Route exact path="/life" component={Life} />
      <Route path="/qiantao" component={Qiantao} />
      <Route path="/index" component={Index} />
      <Route path="/table" component={Table} />
      <Route path="*" component={NotFound} />
    </Switch>)
  }
}
